import request from '@/utils/request'

// 查询供货商订单列表
export function listSupplierorders(query) {
  return request({
    url: '/supplierorders/supplierorders/list',
    method: 'get',
    params: query
  })
}

// 查询供货商订单详细
export function getSupplierorders(orderCode) {
  return request({
    url: '/supplierorders/supplierorders/' + orderCode,
    method: 'get'
  })
}

// 新增供货商订单
export function addSupplierorders(data) {
  return request({
    url: '/supplierorders/supplierorders',
    method: 'post',
    data: data
  })
}

// 修改供货商订单
export function updateSupplierorders(data) {
  return request({
    url: '/supplierorders/supplierorders',
    method: 'put',
    data: data
  })
}

// 删除供货商订单
export function delSupplierorders(orderCode) {
  return request({
    url: '/supplierorders/supplierorders/' + orderCode,
    method: 'delete'
  })
}

// 创建结算单
export function createSettlement(data) {
  return request({
    url: '/record/record',
    method: 'post',
    data: data
  });
}


// 修改订单状态
export function updateOrderStatus(orderCode, status) {
  return request({
    url: `/supplierorders/supplierorders/${orderCode}/status`,
    method: 'put',
    data: { status }
  });
}
